/*
 * @Author: SR. 2761500454@qq.com
 * @Date: 2025-06-29 15:55:11
 * @LastEditors: SR. 2761500454@qq.com
 * @LastEditTime: 2025-06-29 19:26:07
 * @FilePath: \backend-internship\src\main\java\com\lizheng\yunservice\travel\controller\VtpExhibitionHallController.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package com.lizheng.yunservice.travel.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lizheng.yunservice.travel.doamin.VtpExhibitionHall;
import com.lizheng.yunservice.travel.doamin.vo.VtpExhibitionHallVo;
import com.lizheng.yunservice.travel.service.IVtpExhibitionHallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.dev33.satoken.annotation.SaCheckLogin;
import com.lizheng.yunservice.common.domain.ApiRestResponse;
import com.lizheng.yunservice.common.domain.PageQuery;
import com.lizheng.yunservice.common.page.TableDataInfo;

import java.util.HashMap;
import java.util.Map;

/**
 * 展馆相关接口
 *
 * @author SR.
 * @date 2025-06-29
 */
@RestController
@RequestMapping("/vtp/app/exhibitionHall")
public class VtpExhibitionHallController {
    @Autowired
    private IVtpExhibitionHallService exhibitionHallService;

    /**
     * 推荐展馆分页列表
     * @param pageQuery 分页参数
     * @return data为展馆VO列表
     */
    @GetMapping("/getRecommList")
    public TableDataInfo<VtpExhibitionHallVo> getRecommList(PageQuery pageQuery) {
        Page<?> page = pageQuery.build();
        IPage<VtpExhibitionHallVo> result = exhibitionHallService.getRecommListVo(page);
        return TableDataInfo.buildAsData(result);
    }

    /**
     * 展馆分页列表（需登录）
     * @param pageQuery 分页参数
     * @return rows为展馆VO列表
     */
    @SaCheckLogin
    @GetMapping("/list")
    public TableDataInfo<VtpExhibitionHallVo> getHallList(PageQuery pageQuery) {
        Page<?> page = pageQuery.build();
        IPage<VtpExhibitionHallVo> result = exhibitionHallService.getHallListVo(page);
        return TableDataInfo.build(result);
    }

    /**
     * 展馆详情
     * @param hallId 展馆主键
     * @return 展馆VO
     */
    @GetMapping("/detail/{hallId}")
    public ApiRestResponse<VtpExhibitionHallVo> getHallDetail(@PathVariable("hallId") Integer hallId) {
        VtpExhibitionHallVo vo = exhibitionHallService.getHallDetailVo(hallId);
        return ApiRestResponse.ok(vo);
    }
}
